define(['app'], function(app) {
	'use strict';

	var controller = function controller($scope, Service_center,GoPage) {
	$scope.init_data = function(){
		Service_center.get_data(function(data){
			$scope.data= data;
		})
	}
	$scope.go_child = function(article_id,title){
		GoPage.go_states("child-service-center",{"article_id":article_id,"title":title});
	}
	$scope.child_show = function(p_index,index){
		if($scope.data.cusphone[p_index].cat_type[index].is_show == true)
		var is_show = true;
		else
		var is_show = false;
		for(var i=0;i<$scope.data.cusphone.length;i++){
			for(var j=0;j<$scope.data.cusphone[i].cat_type.length;j++){
				$scope.data.cusphone[i].cat_type[j].is_show = false;
			}
		}
		if(is_show!= true)
		$scope.data.cusphone[p_index].cat_type[index].is_show = true;
		else
		$scope.data.cusphone[p_index].cat_type[index].is_show = false;
	}
	$scope.init_data();
	}

	controller.$inject = ['$scope', 'Service_center','GoPage'];
	
	return app.registerController("service_centerctrl",controller);
});